package rabbit.topic;

import java.util.stream.Stream;

/**
 * @author sjw
 * @description
 * @date 2019-09-25 下午5:02
 */
public class StreamTest {
    public static void main(String[] args) {
        Stream.of("Asp", "2019", "9.25-9.27", "Digital")
                .map(x -> 57 == x.charAt(0) ? "Here is" :
                        50 == x.charAt(0) ? x.concat(":") : x)
                .reduce((x, y) ->  x + " " + y).ifPresent(System.out::println);
        Stream.of("Asp", "2019", "9.25-9.27", "Digital")
                .map(x -> (int)x.charAt(0)).reduce(Integer::sum).ifPresent(System.out::println);

    }
}
